﻿using AutoMapper;
using J.FoodManageSet.Application.Command.DishesCommand;
using J.FoodRepository.InterFace;
using MediatR;

namespace J.FoodManageSet.Application.CommandHandler.DishesCommandHandler
{
    /// <summary>
    /// 菜品删除
    /// </summary>
    public class DishesDeleteCommandHandler : IRequestHandler<DishesDeleteCommand, int>
    {
        private readonly IDishesReposittory _dishesReposittory;

        public DishesDeleteCommandHandler(IDishesReposittory dishesReposittory)
        {
            _dishesReposittory = dishesReposittory;
        }
        public async Task<int> Handle(DishesDeleteCommand request, CancellationToken cancellationToken)
        {
            var list = await _dishesReposittory.DishesDelete(request.DishId);
            return list;
        }
    }
}
